package com.zy.explore.db.infrastructure.plugins.multidbsupport.sqlchange;

public class SqlchangeTest {
	public static void main(String[] args) {
		String sql = "";
		sql += "SELECT CONFIG_VALUE\n";
		sql += "FROM (\n";
		sql += "		(SELECT CONFIG_VALUE, CREATE_DATE AS maxTime\n";
		sql += "			FROM t_appcf_config_sort1\n";
		sql += "			WHERE 1 = 1 AND CREATE_DATE IS NOT NULL ORDER BY CREATE_DATE DESC\n";
		sql += "			LIMIT 10\n";
		sql += "		)\n";
		sql += "		UNION ALL\n";
		sql += "			( SELECT CONFIG_VALUE, UPDATE_DATE AS maxTimeselect\n";
		sql += "				FROM t_appcf_config_sort2\n";
		sql += "				WHERE 1 = 1 AND MODULE_ID = 'SF' AND UPDATE_DATE IS NOT NULL\n";
//		sql += "				ORDER BY UPDATE_DATE DESC\n";
		sql += "				LIMIT 2 , 5 ";
		sql += "			)\n";
		sql += "	) a\n";
		sql += "ORDER BY maxTime DESC\n";
		sql += "LIMIT 3;";
		System.out.println(sql);
		System.out.println("===============================");

		String sql2 = Sqlchange.process(sql);
		System.out.println(sql2);
	}
	
}
